var p1 = function(){
    return "I am p1";
}

var p2 = {
    then: function(resolve, reject){
        resolve("I am p2.");
    }
}

var p3 = new Promise(function(resolve, reject){

    setTimeout(function() {
        resolve("I am p3");
    }, 1000);

});

var pa = Promise.all([p1(), p2, p3]).then(function(valArr){
    for (var i = 0; i < valArr.length; i++) {
        var elem = valArr[i];
        console.log(elem);
    }
});
